package com.lex.controller;

import com.lex.common.annoatation.SysLog;
import com.lex.common.api.CommonResult;
import com.lex.common.enums.BusinessType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.lex.entity.sysconfig.SysConfigDto;
import com.lex.service.SysConfigService;
/**
 * 保存平台系统配置参数接口
 */
@RestController
@RequestMapping("/sysconfig")
@Schema(name = "SysConfigController", description = "保存平台系统配置参数接口")
public class SysConfigController {
    @Resource
    private SysConfigService sysConfigService;

    @Operation(summary = "保存平台系统配置参数接口")
    @SysLog(title = "保存平台系统配置参数", businessType = BusinessType.INSERT)
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    public CommonResult saveConfig(@Validated @RequestBody SysConfigDto sysConfigDto) {
        return sysConfigService.saveConfig(sysConfigDto);
    }

    @Operation(summary = "获取平台系统配置参数接口")
    @RequestMapping(value = "/get",method = RequestMethod.GET)
    public CommonResult getConfig(@RequestParam String param_type) {
        return sysConfigService.getConfig(param_type);
    }

}
